home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / softdes.h < prev    next >
C/C++ Source or Header  |  1990-01-22  |  1KB  |  64 lines

  1. /* @(#)softdes.h    1.1 88/04/04 4.0NFSSRC SMI;     from 1.5 88/02/08 Copyr 1986 Sun Micro */
  2. /*
  3.  * softdes.h,  Data types and definition for software DES
  4.  * Copyright (C) 1986, Sun Microsystems, Inc.
  5.  */
  6.  
  7. /*
  8.  * A chunk is an area of storage used in three different ways
  9.  * - As a 64 bit quantity (in high endian notation)
  10.  * - As a 48 bit quantity (6 low order bits per byte)
  11.  * - As a 32 bit quantity (first 4 bytes)
  12.  */
  13. typedef union {
  14.     struct {
  15. #if defined(vax) || defined(i386)
  16.         u_long    _long1;
  17.         u_long    _long0;
  18. #else
  19.         u_long    _long0;
  20.         u_long    _long1;
  21. #endif
  22.     } _longs;
  23. #define    long0    _longs._long0
  24. #define    long1    _longs._long1
  25.     struct {
  26. #if defined(vax) || defined(i386)
  27.         u_char    _byte7;
  28.         u_char    _byte6;
  29.         u_char    _byte5;
  30.         u_char    _byte4;
  31.         u_char    _byte3;
  32.         u_char    _byte2;
  33.         u_char    _byte1;
  34.         u_char    _byte0;
  35. #else
  36.         u_char    _byte0;
  37.         u_char    _byte1;
  38.         u_char    _byte2;
  39.         u_char    _byte3;
  40.         u_char    _byte4;
  41.         u_char    _byte5;
  42.         u_char    _byte6;
  43.         u_char    _byte7;
  44. #endif
  45.     } _bytes;
  46. #define    byte0    _bytes._byte0
  47. #define    byte1    _bytes._byte1
  48. #define    byte2    _bytes._byte2
  49. #define    byte3    _bytes._byte3
  50. #define    byte4    _bytes._byte4
  51. #define    byte5    _bytes._byte5
  52. #define    byte6    _bytes._byte6
  53. #define    byte7    _bytes._byte7
  54. } chunk_t;
  55.  
  56. /*
  57.  * Intermediate key storage
  58.  * Created by des_setkey, used by des_encrypt and des_decrypt
  59.  * 16 48 bit values
  60.  */
  61. struct deskeydata {
  62.     chunk_t    keyval[16];
  63. };
  64.